#include<iostream>
using namespace std;

void foo(void){}  //不要因为使用缺省参数而导致重载歧义

/* 函数参数的缺省值只能在函数声明中指定 */
void foo(char a = 'C', 
	 int b = 8888, 
	 double c = 3.141592, 
	 char const  * d = "缺省字符串" 
	);

void foo(char a /*= 'C'*/, 
	 int  b /*= 8888*/ ,
	 double c /*= 3.141592*/, 
	 char const  * d /*= "缺省字符串"*/ 
	)
{
  cout << a << " " << b << " " << c << " " << d << endl; 
}

// 保证函数的向下兼容
void bar(int)
{
	//....
}

void hum (int x, int y)
{
	cout << "hum(int,int)"<< endl;		
}

// 形成函数的重载版本
void hum (int x, int y,int)
{
	cout << "hum(int,int,int)"<< endl;		
}


int main(void)
{
	
	foo('A',1234,1.23,"Hello World!");
	foo('A',1234,1.23);
	foo('A',1234);
	foo('A');
	//foo();

	bar(100);

	hum(123,456);
	hum(123,456,789);
	return 0;
}

